//
//  Channel.m
//  ipadclient
//
//  Created by Stéphane Prohaszka on 03/06/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Channel.h"


@implementation Channel

@synthesize baseline;
@synthesize spaceId;

- (id) init {
    self = [super init];
    
    if (self) {
        baseline = nil;
    }
    
    return self;
}

- (id) initWithJson:(NSDictionary*)jsonObject {
    self = [super initWithJson:jsonObject];
    
    if (self) {
        baseline = [[jsonObject objectForKey:@"baseline"] retain];
    }
    
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    
    if (self) {
        baseline = [aDecoder decodeObjectForKey:@"baseline"];
    }
    
    return self;
}

- (void)dealloc {
    [baseline release];
    [super dealloc]; 
}

- (id)copyWithZone:(NSZone *)zone {
    Channel* copy = [super copyWithZone:zone];
    copy.baseline = [self.baseline copyWithZone:zone];
    
    return copy;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [super encodeWithCoder:aCoder];
	[aCoder encodeObject:baseline forKey:@"baseline"];
}

@end
